<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
    public function index(Request $request)
    {
        $username = session('username');
        return view('home', [
            'username' => $username,
        ]);
    }

    public function logout(Request $request)
    {
        session(['username' => null]);
        return redirect('/login');
    }
}
